package chatGUI;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;


/**
 * @author Michael & Pierre
 */
/**
 * Listener for Menu button : AddNote
 */

public class AddNoteMenuListener implements ActionListener{
	/**
	 * To keep track of the calling instance of the platform-specific GUI
	 */
	private JavaGUI gui;
	
	/**
	 * Constructor to memorize the calling platform-specific GUI address
	 * @param ihm
	 */
	public AddNoteMenuListener(JavaGUI ihm) {
		this.gui = ihm;
	}
	
	/**
	 * Demands a new note tab with proper index to be added
	 * @param arg0
	 */
	@Override
	public void actionPerformed(ActionEvent arg0) {
		gui.addTab("Note "+gui.getIndexNote(),"", true);
		this.gui.setIndexNote(gui.getIndexNote()+1);
	}
}